﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace lumo.display.object2D
{
    /// <summary>
    /// Particle base class.
    /// </summary>
    public class Particle
    {
        /// <summary>Life of the particle</summary>
        public float   Life = 0;
        /// <summary>Max Life of the particle</summary>
        public float   MaxLife = 0;

        /// <summary>Linear velocity for the particle.</summary>
        public Vector2 LinearPosition = Vector2.Zero;
        /// <summary>Linear velocity for the particle.</summary>
        public Vector2 LinearVelocity = Vector2.Zero;
        /// <summary>Linear acceleration for the particle.</summary>
        public Vector2 LinearAcceleration = Vector2.Zero;
        /// <summary>Linear Force for the particle.</summary>
        public Vector2 LinearForce = Vector2.Zero;

        /// <summary>Rotation for the particle.</summary>
        public float Rotation = 0;
        /// <summary>Angular velocity for the particle.</summary>
        public float AngularVelocity = 0;
        /// <summary>Angular acceleration for the particle.</summary>
        public float   AngularAcceleration = 0;
        /// <summary>Torque for the particle.</summary>
        public float Torque = 0;

        /// <summary>Color For particle</summary>
        public Color Color = Color.White;

        /// <summary>Opacity for particle</summary>
        public float Opacity = 1;
        /// <summary>Scaley for particle</summary>
        public float Scale = 1;

        /// <summary>Check if particle is alive.</summary>
        public virtual bool Alive { get { return (Life <= MaxLife); } }

        /// <summary>User data object</summary>
        public object Data = null;
    }

}
